home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DOS.SWG / 0070_Detecting Share (BASM).pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  2KB  |  65 lines

  1.  { Can one one post some code to check this please.}
  2.  
  3. {--------------------------------------------------------- Share loaded ? ---}
  4. { BAS VAN GAALEN }
  5. function share_loaded : boolean; assembler; asm
  6.   mov ax,01000h; int 02fh; xor ah,ah; and al,0ffh; end;
  7.  
  8. {----------------------------------------------------------------------------}
  9. { ANDREW EIGUS
  10. INT 2F - SHARE - INSTALLATION CHECK
  11.  AX = 1000h
  12. Return: AL = 00h  not installed, OK to install
  13.         01h  not installed, not OK to install
  14.         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  15.  
  16. function will return True here and it should not. So this one will work:
  17. }
  18.  
  19. Function ShareDetected : boolean; assembler;
  20. Asm
  21.   MOV AX,1000h
  22.   INT 2Fh
  23.   CMP AL,0FFh
  24.   JE  @@1
  25.   MOV AL,False
  26.   JMP @@2
  27. @@1:
  28.   MOV AL,True
  29. @@2:
  30. End; { ShareDetected }
  31.  
  32. {----------------------------------------------------------------------------}
  33. {IAN LIN}
  34.  
  35. const
  36.  noshareinstall=0;
  37.  nosharenoinstall=1;
  38.  shareinstalled=$ff;
  39.  
  40. function shareloaded:byte;
  41. assembler; asm
  42.  mov ax,$1000
  43.  int $2f
  44. end;
  45.  
  46. INT 2F - SHARE - INSTALLATION CHECK
  47.         AX = 1000h
  48. Return: AL = 00h  not installed, OK to install
  49.              01h  not installed, not OK to install
  50.              FFh  installed
  51. BUGS:        values of AL other than 00h put DOS 3.x SHARE into an infinite loop
  52.           (08E9: OR  AL,AL
  53.            08EB: JNZ 08EB) <- the buggy instruction (DOS 3.3)
  54.         values of AL other than described here put PC-DOS 4.00 into the same
  55.           loop (the buggy instructions are the same)
  56. Notes:        supported by OS/2 v1.3+ compatibility box, which always returns AL=FFh
  57.         if DOS 4.01 SHARE was automatically loaded, file sharing is in an
  58.           inactive state (due to the undocumented /NC flag used by the autoload
  59.           code) until this call is made
  60.         DOS 5+ chains to the previous handler if AL <> 00h on entry
  61.         Windows Enhanced mode hooks this call and reports that SHARE is
  62.           installed even when it is not
  63. SeeAlso: AX=1080h,INT 21/AH=52h
  64.  
  65.